package com.example.prison.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.prison.entity.Refresh;
import com.example.prison.service.RefreshService;
import com.example.prison.mapper.RefreshMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author jiang
* @description 针对表【refresh】的数据库操作Service实现
* @createDate 2023-06-02 16:15:32
*/
@Service
public class RefreshServiceImpl extends ServiceImpl<RefreshMapper, Refresh>
    implements RefreshService{

    @Autowired
    private RefreshMapper refreshMapper;

    @Override
    public PageInfo<Refresh> get(int pageNumber, int pageSize) {
        PageHelper.startPage(pageNumber, pageSize);
        return new PageInfo<>(refreshMapper.get());
    }

    @Override
    public Refresh getById(Integer id) {
        return refreshMapper.getById(id);
    }

    @Override
    public int add(Refresh rate) {
        refreshMapper.add(rate);
        return 1;
    }

    @Override
    public int update(Integer id, Integer rate) {
        refreshMapper.updateDevice(id, rate);
        return 1;
    }

}




